﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Controller;
using Model;

namespace Biffen
{
    public partial class SearchUI : Form
    {
        MovieCtr movieCtr = new MovieCtr();

        public SearchUI()
        {
            InitializeComponent();
        }

        private void btnSearch_Click(object sender, EventArgs e)
        {
            List<string> genres = new List<string>();
            foreach (string item in checkedListGenre.SelectedItems)
	        {
		        genres.Add(item.ToString());
	        }

            List<Event> list = movieCtr.FindEvent(txtTitle.Text, txtInstructor.Text, txtActor.Text, ddPlayTime.SelectedText, txtDate.Text, genres);

            foreach (Event item in list)
            {
                listBox1.Items.Add(item.Movie.Title);
            }
        }
    }
}
